package Tools;

public class CenterDistace implements DistanceFun{

	public double calculate(double[][] a, double[][] b) {
		double sum=0;
		for(int i=0;i<a.length;i++){
			double cenA=a[i][0]+((a[i][1]-a[i][0])/2);
			double cenB=a[i][0]+((b[i][1]-b[i][0])/2);
			sum+=(cenA-cenB)*(cenA-cenB);
		}
		return Math.sqrt(sum);
	}

}
